const request = require('../utils/request');
const stringify = require('qs').stringify;
const api4back = {};


api4back.loginByBackMobileCode = async (param) => {
    return request(`/yjx/v1/api4back/api4back/loginByBackMobileCode?${stringify(param)}`);
};


/**
 * 获取推广方信息
 * @author 李强
 * @date 2018-07-3
 */
api4back.getPromoterInfo = async (param) => {
    return request('/yjx/v1/user/getUserDetailInfo_v1_0', {
        method: 'POST',
        body: param
    });
};

/**
 * 获取手机号验证码
 * @author 李强
 * @date 2018-07-3
 */
api4back.getBackMobileVerCode = async (param) => {
    return request('/yjx/v1/api4back/api4back/getBackMobileVerCode', {
        method: 'POST',
        body: param
    });
};


/**
 * 验证验证码
 * @author 李强
 * @date 2018-07-3
 */
api4back.checkBalkMobileCode = async (param) => {
    return request('/yjx/v1/api4back/api4back/loginByBackMobileCode', {
        method: 'POST',
        body: param
    });
};

/**
 * 获取推广码列表
 * @author 李强
 * @date 2018-07-3
 */
api4back.getPromoCodeList = async (param) => {
    return request('/yjx/v1/api4back/api4back/getPromoCodeList', {
        method: 'POST',
        body: param
    });
};

/**
 * 生成优惠码/推广码
 * @author 李强
 * @date 2018-07-3
 */
api4back.createPromoCode = async (param) => {
    return request('/yjx/v1/api4back/api4back/createPromoCode', {
        method: 'POST',
        body: param
    });
};

/**
 * 生成优惠码/推广码
 * @author 李强
 * @date 2018-07-3
 */
api4back.getPromoCodeRewardList = async (param) => {
    return request('/yjx/v1/api4back/api4back/getPromoCodeRewardList', {
        method: 'POST',
        body: param
    });
};

module.exports = api4back;
